#ifndef GAMEENGINE_CORE_GRAPH_NODE_HPP
#define GAMEENGINE_CORE_GRAPH_NODE_HPP

#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif

//! Default constructor
/*!
 @note Class T should have a default constructor
 */
template <class T>
GraphNode<T>::GraphNode() {}

//! Constructor
/*!
 @param value The value associated to the node
 @note Class T should have a copy constructor
 */
template <class T>
GraphNode<T>::GraphNode(const T& value) :
	value_(value) {}

//! Copy constructor
/*!
 @param rhs The node to copy
 @note Class T should have a copy constructor
 */
template <class T>
GraphNode<T>::GraphNode(const GraphNode& rhs) :
	value_(rhs.value_) {}

//! Destructor
template <class T>
GraphNode<T>::~GraphNode() {}

//! Assignment operator
/*!
 @param rhs The node to copy
 @note Class T should have an assignment operator
 */
template <class T>
GraphNode<T>& GraphNode<T>::operator=(const GraphNode& rhs) {
	if ( &rhs != this ) {
		value_ = rhs.value_;
	}
	return *this;
}

//! Comparison operator
/*!
 @param rhs The node to compare
 @return True if the nodes are the same, false otherwise
 @note Type T should have a comparison operator
 */
template <class T>
bool GraphNode<T>::operator==(const GraphNode& rhs) const {
	return ( value_ == rhs.value_ );
}

//! Difference operator
/*!
 @param rhs The node to compare
 @return True if the nodes are different, false otherwise
 @note Type T should have a difference operator
 */
template <class T>
bool GraphNode<T>::operator!=(const GraphNode& rhs) const {
	return ( value_ != rhs.value_ );
}

//! Inferior operator
/*!
 @param rhs The node to compare
 @return True if the other node is inferior to the current node, false otherwise
 @note Type T should have an inferior operator
 */
template <class T>
bool GraphNode<T>::operator<(const GraphNode& rhs) const {
	return ( value_ < rhs.value_ );
}

//! Accessor to the value associated to the node (read-write)
/*!
 @return A reference to the value associated to the node
 */
template <class T>
T& GraphNode<T>::value() {
	return value_;
}

//! Accessor to the value associated to the node (read only)
/*!
 @return A constant reference to the value associated to the node
 */
template <class T>
const T& GraphNode<T>::value() const {
	return value_;
}

#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#endif
